import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:"/home/class"
  },
  {
    path: '/',
    name: 'Home',
    component:  () => import( '../views/Home.vue'),
    children:[
      {
        path: '/home/class',
        name: 'class',
        component: () => import( '../views/home/class.vue')
      },
      {
        path: '/home/login',
        name: 'login',
        component: () => import( '../views/home/login.vue')
      },
      {
        path: '/home/reg',
        name: 'reg',
        component: () => import( '../views/home/reg.vue')
      },
      {
        path: '/home/stu',
        name: 'stu',
        component: () => import( '../views/home/stu.vue')
      },
    ]
  },
  {
    path: '/about',
    name: 'About',
    component: () => import( '../views/About.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
